package net.ak.service.impl;

import java.util.List;

import net.ak.dao.CategoryDao;
import net.ak.model.Category;
import net.ak.service.CategoryService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CategoryServiceImpl implements CategoryService{

	@Autowired
	private CategoryDao categoryDao;
	
	/* (non-Javadoc)
	 * @see net.ak.service.CategoryService#listCategories()
	 */
	@Override
	public List<Category> listCategories() {
		return categoryDao.listCategories();
	}

	/* (non-Javadoc)
	 * @see net.ak.service.CategoryService#saveOrUpdate(net.ak.model.Category)
	 */
	@Override
	public boolean saveOrUpdate(Category category) {
		return categoryDao.saveOrUpdate(category);
	}

	/* (non-Javadoc)
	 * @see net.ak.service.CategoryService#getCategoryByName(java.lang.String)
	 */
	@Override
	public Category getCategoryByName(String categoryName) {
		return categoryDao.getCategoryByName(categoryName);
	}

	/* (non-Javadoc)
	 * @see net.ak.service.CategoryService#getCategoryById(java.lang.Long)
	 */
	@Override
	public Category getCategoryById(Long id) {
		return categoryDao.getCategoryById(id);
	}

	/* (non-Javadoc)
	 * @see net.ak.service.CategoryService#searchCategoryByName(java.lang.String)
	 */
	@Override
	public List<Category> searchCategoryByName(String categoryName) {
		return categoryDao.searchCategoryByName(categoryName);
	}

}
